
<script type="text/javascript">
        function tmAdd(id){
        	
        	$("#productionPatternId").val(id);
        	$('#tm_add').modal({
    			keyboard: true
    		});
        }
        function saveTmAdd(opFlag){
        	
      	$("#tm_add_form").ajaxSubmit({  
	            type : "POST",  
	            url: "../productionpattern/saveTM?id="+$("#productionPatternId").val(),
	            data:{opFlag:opFlag},
	            dataType : "json",   
	            success : function(map) {  
	            	 if(map.head.respCode=="0000000"){
		                	alert("保存成功");
		                	window.location.href="list";
		                }else{
		                	alert(map.body);
		                }
	            },  
	            error : function(map) {  
	                alert("出现错误，请刷新页面");  
	            }  
	  
	        }) 
        }
        </script>
<div class="modal fade" id="tm_add" tabindex="-1" role="dialog"
	aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="myModalLabel">上传推码表</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" role="form" id="tm_add_form" enctype="multipart/form-data">

					  <div class="form-group">
    <input type="file" name="file" >
  </dnv>
				</form>
			</div>
			<div class="modal-footer">
				<button type="button" onclick="saveTmAdd(0)"
					class="btn btn-primary">确定</button>
					
				<button type="button" class="btn btn-default" data-dismiss="modal">
					取消</button>
			</div>
		</div>
		<!-- /.modal-content -->
	</div>
	<!-- /.modal -->
</div>